package me.hellp.helloworld.design.flyweight;

import java.util.HashMap;
import java.util.Map;

public class FlyWeightFactory {
	private static final Map<Integer,Student> map = new HashMap<Integer,Student>();
	
	static {
		for(int i=0; i<1000; i++){
			map.put(i, new Student(i, "名字" + i));
		}
	}
	public static FlyWeight getFlyWeight(Integer id){
		return map.get(id);
	}
}
